<template>
	<base-page :title="title" backgroundColor="white">
		<view class="p-16">
			<rich-text v-if="detail" :nodes="detail.details"></rich-text>
		</view>
	</base-page>
</template>

<script setup name="ContentDetail">
	import { onLoad } from '@dcloudio/uni-app'
	import { ref, getCurrentInstance, computed } from 'vue'
	
	const instance = getCurrentInstance()
	
	const detail = ref()
	
	const title = computed(() => {
		return detail.value && detail.value.title
	})
	
	onLoad(() => {
		const eventChannel = instance.ctx.getOpenerEventChannel()
		eventChannel.on('acceptDataFromOpenerPage', (data) => {
			detail.value = data
		})
	})
</script>
